-- GENERATED SPELL FOR [Cyclonian] --


function spell0_6239(pUnit, Event) --@Gust of Wind,Self--
pUnit:FullCastSpellOnTarget(6982,pUnit)
pUnit:RegisterEvent('Sorts_6239', 6000, 1)
end

function spell1_6239(pUnit, Event) --@Knock Away,n/a--
pUnit:FullCastSpellOnTarget(18670,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_6239', 651, 1)
end

function spell2_6239(pUnit, Event) --@Whirlwind,Self--
pUnit:FullCastSpellOnTarget(15576,pUnit)
pUnit:RegisterEvent('Sorts_6239', 663, 1)
end

function spell3_6239(pUnit, Event) --@Whirlwind,Self--
pUnit:FullCastSpellOnTarget(17207,pUnit)
pUnit:RegisterEvent('Sorts_6239', 2000, 1)
end

function Sorts_6239(pUnit, Event)
local choix_sorts_6239 = math.random(0, 3)
if choix_sorts_6239 == 0 then
pUnit:RegisterEvent('spell0_6239', 1, 1)
end
if choix_sorts_6239 == 1 then
pUnit:RegisterEvent('spell1_6239', 1, 1)
end
if choix_sorts_6239 == 2 then
pUnit:RegisterEvent('spell2_6239', 1, 1)
end
if choix_sorts_6239 == 3 then
pUnit:RegisterEvent('spell3_6239', 1, 1)
end
end

function mob6239_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_6239', math.random(1500, 3000), 1)
end

function mob6239_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob6239_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob6239_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(6239, 1, 'mob6239_Action')
RegisterUnitEvent(6239, 2, 'mob6239_Leave')
RegisterUnitEvent(6239, 3, 'mob6239_Kill')
RegisterUnitEvent(6239, 4, 'mob6239_Die')
